<%-- 
    Document   : NicholasviewFeedbacks
    Created on : Apr 18, 2011, 11:57:58 PM
    Author     : ChuckToh
--%>
<%@page import="java.sql.ResultSet"%>
<%@page import="NicholasValueBeans.Feedback"%>
<h3>View Feedbacks</h3>
<%
            Feedback fb = new Feedback();
            ResultSet allFeedbacks = fb.getAllFeedbacks();
            ResultSet allFeedbacks2 = fb.getAllFeedbacks();
            int allFeedbacksCount = 0;

            while (allFeedbacks2.next()) {
                allFeedbacksCount++;
            }

            if (allFeedbacksCount > 0) {
                out.println("<table cellspacing='5' cellpadding='5' border='1'>");
                out.println("<tr>");
                out.println("<th align='left'>User ID</th>");
                out.println("<th align='left'>Feedback</th>");
                out.println("<th align='left'>Submitted Date</th>");
                out.println("</tr>");
                while (allFeedbacks.next()) {
                    out.println("<tr>");
                    out.println("<td align='left'>" + allFeedbacks.getString("userId") + "</td>");
                    out.println("<td align='left'>" + allFeedbacks.getString("remarks") + "</td>");
                    out.println("<td align='left'>" + allFeedbacks.getDate("dateCreated") + "</td>");
                    out.println("</tr>");
                }
                out.println("</table>");
            } else {
                out.println("No feedback has been received yet!");
            }
%>